package liangtWorkSpace.singleDemo;

/**
 * @ClassName Mag01
 * @Description : 功能说明
 * @Author : LiangT
 * @Date : 2020/4/9 18:11
 */

/**
 * 单例模式一
 * .Class.forName("");
 */
public class Mag01 {
    private static Mag01 INSTANCE = new Mag01();
    private Mag01(){}

    public static Mag01 getMag01(){
        return INSTANCE;
    }
    public void m(){
        System.out.println("m");
    }

    public static void main(String[] args) {
        Mag01 mag01 = Mag01.getMag01();
        Mag01 mag02 = Mag01.getMag01();
        System.out.println(mag01 == mag02);
    }
}
